# Contributor: Guy Godfroy <guy.godfroy@gugod.fr>
# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=py3-xsdata
pkgver=24.5
pkgrel=0
pkgdesc="Naive XML & JSON Bindings for python"
url="https://github.com/tefra/xsdata"
arch="noarch"
license="MIT"
depends="
	py3-click
	py3-click-default-group
	py3-docformatter
	py3-jinja2
	py3-toposort
	ruff
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-lxml
	py3-pytest-benchmark
	py3-pytest-forked
	py3-requests
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/tefra/xsdata/archive/refs/tags/v$pkgver.tar.gz
	typing.patch
	"
builddir="$srcdir/xsdata-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest --forked
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
554da863993042d1242beb8e69c7e1e2124453f7cefa10604677ab5027ccbdbe0d495edfed6967df931c5b73f7a9c3956de98b46f9e6f122dc25102ee01f8d48  py3-xsdata-24.5.tar.gz
b5f3740ef356e501652d1370b2ea527f69e4ce8624721e88bcdaeb98e665e00c585dcc9d2ba3da93ac80a90011a6ea451530fb87d9bcb5aa10303df9d078fde0  typing.patch
"
